﻿<telerik:RadWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                   xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                   xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                   xmlns:local="clr-namespace:Rio.Framework.Pages.ChildWindows"
                   xmlns:Viewer="clr-namespace:Rio.Framework.Pages;assembly=Rio.Framework.Pages"
                   xmlns:System="clr-namespace:System;assembly=mscorlib"
                   x:Name="radWindow"
                   x:Class="Rio.Framework.Pages.ChildWindows.RemindWindow"
                   mc:Ignorable="d"
                   d:DesignWidth="700"
                   d:DesignHeight="400"
                   Width="700"
                   Header="Relance">

    <telerik:RadWindow.Resources>
        <local:RemindWindowDisplayModeToVisibilityConverter x:Key="RemindWindowDisplayModeToVisibilityConverter" />
        <local:RemindWindowDsplayModeToBooleanConverter x:Key="RemindWindowDsplayModeToBooleanConverter" />
    </telerik:RadWindow.Resources>

    <!--message header-->
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="55" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="34" />
            <RowDefinition Height="34" />
            <RowDefinition Height="90" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MaxWidth="120" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <Border  Height="50"
                 HorizontalAlignment="Stretch"
                 Grid.Row="0"
                 Grid.ColumnSpan="2">
            <Grid Width="680">
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Left">
                    <Image Source="../Assets/Images/Remind.png"
                           Width="42"
                           Height="42" />
                    <TextBlock x:Name="ValidatorMsg"
                               Margin="10,5,0,5"
                               Foreground="Red"
                               TextWrapping="Wrap"
                               FontWeight="Bold"
                               Width="500"
                               HorizontalAlignment="Stretch"
                               Visibility="Collapsed" />
                </StackPanel>
            </Grid>
        </Border>
        <dataInput:Label x:Name="remindTypeLabel"
                         Width="110"
                         Height="15"
                         HorizontalAlignment="Left"
                         VerticalAlignment="Top"
                         Margin="4,5,0,0"
                         Grid.Row="1"
                         Grid.Column="0"
                         Content="Type de relance"
                         Visibility="{Binding Mode, Converter={StaticResource RemindWindowDisplayModeToVisibilityConverter}, ElementName=radWindow, Mode=TwoWay}" />
        <StackPanel Grid.Column="1"
                    Grid.Row="1"
                    Margin="5"
                    Visibility="{Binding Mode, Converter={StaticResource RemindWindowDisplayModeToVisibilityConverter}, ElementName=radWindow, Mode=TwoWay}">
            <RadioButton x:Name="checkbox_Workflow_ReceiverType1"
                         Content="Relance au destinataire"
                         IsChecked="{Binding RemindWorkflowReceiver, ElementName=radWindow, Mode=TwoWay}"
                         GroupName="ReceiverTypeGroup" />
            <RadioButton x:Name="checkbox_Workflow_ReceiverType2"
                         Content="Relance aux personnes concernées par le flux"
                         GroupName="ReceiverTypeGroup"
                         Margin="0,5,0,0" />
        </StackPanel>
        <Button x:Name="ButtonTo"
                Width="90"
                Height="30"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Margin="5,0,5,0"
                Grid.Column="0"
                Grid.Row="2"
                Click="buttonTo_Click"
                IsEnabled="{Binding Mode, Converter={StaticResource RemindWindowDsplayModeToBooleanConverter}, ElementName=radWindow, Mode=TwoWay}" />
        <StackPanel Orientation="Horizontal"
                    Grid.Column="1"
                    Grid.Row="2">
            <TextBox x:Name="ToTextBox"
                     Width="400"
                     Margin="5,5,5,5"
                     IsReadOnly="True" />
            <TextBlock x:Name="AlertToMandatory"
                       Text="*"
                       Margin="0,10,5,0"
                       Foreground="Red"
                       HorizontalAlignment="Left" />
        </StackPanel>

        <dataInput:Label x:Name="LabelObject"
                         Width="110"
                         Height="15"
                         HorizontalAlignment="Left"
                         VerticalAlignment="Top"
                         Margin="5,5,5,0"
                         Grid.Column="0"
                         Grid.Row="3" />
        <StackPanel Orientation="Horizontal"
                    Grid.Column="1"
                    Grid.Row="3">
            <TextBox x:Name="ObjectTextBox"
                     Width="400"
                     Margin="5,5,5,5"
                     HorizontalAlignment="Left"
                     MaxLength="256" />
            <TextBlock x:Name="ObjectToMandatory"
                       Text="*"
                       Margin="0,10,5,0"
                       Foreground="Red"
                       HorizontalAlignment="Left" />
        </StackPanel>

        <dataInput:Label x:Name="LabelMemo"
                         Width="110"
                         Height="15"
                         HorizontalAlignment="Left"
                         VerticalAlignment="Top"
                         Margin="4,5,0,0"
                         Grid.Row="4"
                         Grid.Column="0" />
        <TextBox x:Name="MemoTextBox"
                 Grid.Column="1"
                 Grid.Row="4"
                 Margin="5,5,5,5"
                 AcceptsReturn="True"
                 HorizontalScrollBarVisibility="Auto"
                 VerticalScrollBarVisibility="Auto"
                 TextWrapping="Wrap"
                 VerticalAlignment="Stretch"
                 MaxLength="8000" />

        <StackPanel Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    Grid.Row="6"
                    Grid.Column="1"
                    Margin="0,5">
            <Button x:Name="buttonSend"
                    Width="117"
                    Height="30"
                    Click="buttonSend_Click" />
            <Button x:Name="buttonCancel"
                    Width="117"
                    Height="30"
                    Click="buttonCancel_Click"
                    Margin="5,0,5,0" />
        </StackPanel>
    </Grid>

</telerik:RadWindow>